<template>
  <div class="myrent-page">
    <div class="block"></div>
    <van-nav-bar fixed title="房屋管理" left-arrow @click-left="$router.back()" />
    <van-list
      v-model="loading"
      :finished="finished"
      finished-text="没有更多了"
      @load="onLoad"
    >
      <HouseItem
        v-for="(item, index) in list"
        :key="index"
        :item="item"
      ></HouseItem>
    </van-list>
  </div>
</template>

<script>
import HouseItem from "@/components/House_Item.vue";
import { getMyrent } from "@/api/user";
export default {
  name: "myrent-page",
  components: {
    HouseItem,
  },
  data() {
    return {
      list: [],
      loading: false,
      finished: false,
    };
  },
  methods: {
    async onLoad() {
      const { body } = await getMyrent();
      this.list = body;
      this.finished = true;
    },
  },
};
</script>

<style lang="less" scoped>
.block{
  height: 46px;
}
</style>
